#pragma once
#include "Ogre.h"
using namespace Ogre;

 

class mirror : public RenderTargetListener //, public OgitorsRootListener
{
public:
	mirror(void);
	~mirror(void);

// 	  void OnTerminateScene() ;
// 	  void OnAfterLoadScene() ;
// 	  void OnUpdate(float time) ;

	  // render target events
	void preRenderTargetUpdate(const RenderTargetEvent& evt)
	{
		// Hide plane 
		mPlaneEnt->setVisible(false);

	}
	void postRenderTargetUpdate(const RenderTargetEvent& evt)
	{
		// Show plane 
		mPlaneEnt->setVisible(true);
	}
	void updata();
	void init(	Ogre::RenderWindow* mWindow, 
	Ogre::Camera* mCamera,
	MovablePlane*  mPlane,
	Entity*        mPlaneEnt,
   SceneNode*     PlaneNode,
	Ogre::SceneManager* mSceneMgr ); 
private:

	Ogre::RenderWindow* mWindow; 
	Ogre::Camera* mCamera;   
	MovablePlane*  mPlane;
	Entity*        mPlaneEnt;
	Camera*        mReflectCam;
	SceneNode*     mPlaneNode;
	Ogre::SceneManager* mSceneMgr;

	TexturePtr texture;
	RenderTarget *rttTex;
};
